package com.daedalus.Polimorfizmi.InterfaceAbstractShape;

public class Main {

	public static void main(String[] args){
		Circle circle=new Circle(3.0);
		Square square=new Square(6.0);
		Triangle triangle=new Triangle(4.0);
		
		Sphere sphere=new Sphere(3.0);
		Cube cube=new Cube(5.0);
		Tetraeder tetra=new Tetraeder(6.0);
		
		Shape matrica[][]={{circle,square,triangle},{sphere,cube,tetra}};
		
		for(int i=0;i<2;i++)
			for(int j=0;j<3;j++){
				System.out.println();
				System.out.print(matrica[i][j].toString());
				if (matrica[i][j] instanceof TwoDimensionalShape){
					TwoDimensionalShape c=(TwoDimensionalShape)matrica[i][j];
					System.out.printf("\n      Area:     %.2f  ",c.getArea());
				}
				if (matrica[i][j] instanceof ThreeDimensionalShape){
					ThreeDimensionalShape c=(ThreeDimensionalShape)matrica[i][j];
					System.out.printf("\n      Area:     %.2f  ",c.getArea());
					System.out.printf("\n      Volume:   %.2f  \n",c.getVolume());				
				}
			}
	}
}
